package com.fcscs.cservice.client.main.ui;

import com.fcscs.cservice.client.main.configuration.iguest.iGuestLoginOptionDialog.LoginOption;
import com.google.gwt.event.shared.GwtEvent;
import com.google.gwt.event.shared.HasHandlers;

public class DialogEvent extends GwtEvent<DialogEventHandler>{

	public static final Type<DialogEventHandler> TYPE = new Type<DialogEventHandler>();
	
	private String password;
	private String username;
	private LoginOption option;
	
//	public DialogEvent(String pass, String user, String value){
//		password = pass;
//		username = user;
//		this.value = value;
//	}
	public DialogEvent(LoginOption option, String user,String pass){
		super();
		password = pass;
		username = user;
		this.option = option;
	}
	
	@Override
	protected void dispatch(DialogEventHandler arg0) {
		// TODO Auto-generated method stub
		arg0.onOkButton(this);
	}

	@Override
	public com.google.gwt.event.shared.GwtEvent.Type<DialogEventHandler> getAssociatedType() {
		// TODO Auto-generated method stub
		return TYPE;
	}
	
	public static void fireOkEvent(HasHandlers source, DialogEvent e){
		source.fireEvent(e);
	}
	public LoginOption getOption(){
		return option;
	}
	public String getPassword(){
		return password;
	}
	
	public String getUsername(){
		return username;
	}
	
	
	
}
